package com.example.last.dao;

import com.example.last.entity.Account;
import com.example.last.entity.Admin;
import com.example.last.entity.Params;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface AdminDao {

    //登录注册
    Admin findByNameAndPassword(@Param("username") String username, @Param("password") String password);

    //用户注册
    void addRegister(Admin admin);

    List<Admin> findBySearch(@Param("params") Params params);

    void add(Admin admin);

    Admin findByName(@Param("username") String username);

    void update(Admin admin);

    void delete(Integer id);

    //jwt拦截器
    Admin selectByPrimaryKey(Integer id);

    Admin selectByUsername(@Param("username") String username);

    void updatePassword(Account account);
}